package com.hawthorn.admin.controller.syscalendar;

import com.hawthorn.admin.service.syscalendar.SysCalendarService;
import com.hawthorn.platform.context.ContextHolder;
import com.hawthorn.platform.exception.BizCode;
import com.hawthorn.platform.utils.iassert.AssertMyUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>todo 日历事项管理 </p>
 * @author: andyten@tom.com | xukaixing@hotmail.com
 * @created: 2021/11/25 4:19 PM
 * @version v1.0.1
 * @copyright: Copyright (c)  andyten
 */
@Api(tags = {"admin-syscalendar"})
@RestController
@RequestMapping("/syscalendar/")
@Slf4j
public class SysCalendarController
{

  @Autowired
  private SysCalendarService sysCalendarService;


  @ApiOperation(value = "查询->获取首页日历事项", notes = "获取首页日历事项")
  @ApiImplicitParams({
  })
  @GetMapping(value = "/findCalendarEventList")
  public List<Map<String, Object>> findCalendarEventList()
  {
    String userAccount = ContextHolder.getUserAccount();
    AssertMyUtil.notNull(userAccount, BizCode.VARIABLE_NOT_EMPTY, "userAccount");
    return sysCalendarService.findCalendarEventList(userAccount);
  }
}
